<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"  
      xmlns:h="http://java.sun.com/jsf/html"  
      xmlns:f="http://java.sun.com/jsf/core"  
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:c="http://java.sun.com/jsp/jstl/core">  

    <h:head>
        <meta http-equiv="Refresh" />
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>Informations</title>
        <link href="assets/css/tek.css" rel="stylesheet"/>

        <script language="javascript">
            function ConfirmDelete(link)
            {
                var del = confirm('Do you want to Delete?');
                if (del == true) {
                    link.onclick();
                }
            }
        </script>
    </h:head>
    <h:body onload="document.myform.author.focus();" >
        <ui:include src="header_1.xhtml" />
        <f:view>
            <br/>
            <h:panelGrid style="margin: 0 auto;" columns="1" width="50%" >

                <h:form id="myform" prependId="false"> 

                    <h:panelGrid columnClasses="alignTop,alignTop" columns="2" style="vertical-align: top;"  >
                        <p:panel    header="Informations" style=" background-color: lightslategray;height: 500px;width: 400px;">  
                            <h:panelGrid style="color: yellow;font-weight: bold" columnClasses="alignTop,alignTop" columns="2">
                                <h:outputText value="Nombre billets :" style="color: white;font-weight: bold;" />
                                <h:outputText  value="#{venteBean.typebsKit.size()}" />
                                <h:outputText value="Prix Total:" style="color: white;font-weight: bold;" />
                                <h:outputText  value="#{venteBean.prixkit} DT" />
                                 <h:outputText value="Prix avec remise:" style="color: white;font-weight: bold;" />
                                 <h:outputText  value="#{venteBean.prixRemise} DT" />
                                
                                
                                
                            </h:panelGrid>
                            
                        </p:panel>               
                        <h:panelGrid style="margin-left: 5%;" columns="1" >
                            <h:panelGrid columns="2">
                                <h:panelGrid columns="1">
                                    <p:panel    header="code à barre ticket" style=" background-color: cornflowerblue;width: 336px;">  
                                        <h:panelGrid columns="2">                                          
                                            <h:outputLabel value="code :" ></h:outputLabel>  
                                            <p:inputText     id="author" value="#{venteBean.ser}"/>    
                                        </h:panelGrid>  
                                        <h:panelGrid columns="3">
                                            <h:commandButton  class="btn btn-success" value="Ajouter" id="d" oncomplete="document.myform.author.focus();"  actionListener="#{venteBean.createNew()}" update="author,k" /> 

                                            <h:commandButton class="btn btn-warning"  value="Enregistrer" action="#{venteBean.enregistrer()}" />
                                            <p:commandButton styleClass="btn btn-small" style="font-size: x-small"  value="vider" onclick="confirmation.show()"   />
                                           
                                        </h:panelGrid>
                                        
                                        <h:commandButton style="margin-top: 10px;" styleClass="btn btn-inverse"    value="retourner" action="#{venteBean.retour()}"   />

                                    </p:panel> 
                                </h:panelGrid>
                            </h:panelGrid>
                            <h:panelGrid id="k" style="height: 100px; " width="23%">
                                <p:messages   id="messages" showDetail="true" autoUpdate="true"/>  
                                <c:forEach  items="#{venteBean.carNew}" var="car" >
                                    <h:panelGrid style="vertical-align: top;" columns="2" >
                                        <h:inputText readonly="true" value="#{car}" />
                                        <p:commandButton  action="#{venteBean.delete(car)}" style="font-size: small"  ajax="false" value="supprimer" />
                                    </h:panelGrid>
                                </c:forEach>
                            </h:panelGrid>
                            <p:confirmDialog id="confirmDialog" message="Voulez vous vraiment vider la table?"  
                                             header="Vider" severity="alert" widgetVar="confirmation">  
                                <p:commandButton id="confirm" value="Yes Sure" oncomplete="confirmation.hide()"  
                                                 actionListener="#{venteBean.vider()}" update="k" />  
                                <p:commandButton id="decline" value="Not Yet" onclick="confirmation.hide()" type="button" />
                            </p:confirmDialog> 
                        </h:panelGrid>
                    </h:panelGrid>
                </h:form>  
            </h:panelGrid>
        </f:view>
    </h:body>
</html>